import React from 'react';
import { Tooltip } from 'antd';

export const renderText = (text: string) => {
  text = text || '';
  const maxLength = 28;
  const showText = text.length > maxLength ?
    text.substring(0, maxLength - 1) + '...' : text;
  return (
    <Tooltip title={text}>
      <span style={{ cursor: 'pointer' }}>
        {showText}
      </span>
    </Tooltip>
  );
};
